# -*- coding: utf-8 -*-
"""
场馆相关接口的Swagger文档定义
"""

GET_VENUE_LIST_DOC = {
    "tags": ["场馆管理"],
    "summary": "获取场馆列表",
    "description": "获取所有可用场馆的列表，支持分页和筛选",
    "parameters": [
        {
            "name": "page",
            "in": "query",
            "type": "integer",
            "required": False,
            "description": "页码，从1开始",
            "example": 1,
            "default": 1
        },
        {
            "name": "perPage",
            "in": "query",
            "type": "integer",
            "required": False,
            "description": "每页数量",
            "example": 10,
            "default": 10
        },
        {
            "name": "type",
            "in": "query",
            "type": "string",
            "required": False,
            "description": "场馆类型筛选",
            "example": "basketball"
        },
        {
            "name": "location",
            "in": "query",
            "type": "string",
            "required": False,
            "description": "位置筛选",
            "example": "北京"
        },
        {
            "name": "keyword",
            "in": "query",
            "type": "string",
            "required": False,
            "description": "关键词搜索",
            "example": "篮球场"
        }
    ],
    "responses": {
        "200": {
            "description": "获取场馆列表成功",
            "schema": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200,
                        "description": "状态码"
                    },
                    "message": {
                        "type": "string",
                        "example": "获取成功",
                        "description": "响应消息"
                    },
                    "data": {
                        "type": "object",
                        "description": "场馆列表数据",
                        "properties": {
                            "total": {
                                "type": "integer",
                                "example": 25,
                                "description": "总记录数"
                            },
                            "pages": {
                                "type": "integer",
                                "example": 3,
                                "description": "总页数"
                            },
                            "page": {
                                "type": "integer",
                                "example": 1,
                                "description": "当前页码"
                            },
                            "perPage": {
                                "type": "integer",
                                "example": 10,
                                "description": "每页数量"
                            },
                            "venues": {
                                "type": "array",
                                "description": "场馆列表",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "场馆ID"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "中央篮球场",
                                            "description": "场馆名称"
                                        },
                                        "type": {
                                            "type": "string",
                                            "example": "basketball",
                                            "description": "场馆类型"
                                        },
                                        "address": {
                                            "type": "string",
                                            "example": "北京市朝阳区体育馆路1号",
                                            "description": "场馆地址"
                                        },
                                        "location": {
                                            "type": "string",
                                            "example": "北京",
                                            "description": "所在区域"
                                        },
                                        "latitude": {
                                            "type": "number",
                                            "example": 39.9042,
                                            "description": "纬度"
                                        },
                                        "longitude": {
                                            "type": "number",
                                            "example": 116.4074,
                                            "description": "经度"
                                        },
                                        "description": {
                                            "type": "string",
                                            "example": "标准篮球场，设施齐全",
                                            "description": "场馆描述"
                                        },
                                        "images": {
                                            "type": "array",
                                            "description": "场馆图片URL列表",
                                            "items": {
                                                "type": "string",
                                                "example": "https://example.com/venue1.jpg"
                                            }
                                        },
                                        "contact_phone": {
                                            "type": "string",
                                            "example": "010-12345678",
                                            "description": "联系电话"
                                        },
                                        "open_time": {
                                            "type": "string",
                                            "example": "08:00-22:00",
                                            "description": "营业时间"
                                        },
                                        "max_capacity": {
                                            "type": "integer",
                                            "example": 50,
                                            "description": "最大容量"
                                        },
                                        "status": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "状态：0=关闭，1=开放"
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "example": "2024-01-01 12:00:00",
                                            "description": "创建时间"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "400": {
            "description": "请求参数错误",
            "schema": {
                "type": "object",
                "properties": {
                    "code": {"type": "integer", "example": 400},
                    "message": {"type": "string", "example": "请求参数错误"}
                }
            }
        }
    }
}

GET_VENUE_DETAIL_DOC = {
    "tags": ["场馆管理"],
    "summary": "获取场馆详情",
    "description": "根据场馆ID获取详细信息",
    "parameters": [
        {
            "name": "venue_id",
            "in": "path",
            "type": "integer",
            "required": True,
            "description": "场馆ID",
            "example": 1
        }
    ],
    "responses": {
        "200": {
            "description": "获取场馆详情成功",
            "schema": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200,
                        "description": "状态码"
                    },
                    "message": {
                        "type": "string",
                        "example": "获取成功",
                        "description": "响应消息"
                    },
                    "data": {
                        "type": "object",
                        "description": "场馆详细信息",
                        "properties": {
                            "id": {
                                "type": "integer",
                                "example": 1,
                                "description": "场馆ID"
                            },
                            "name": {
                                "type": "string",
                                "example": "中央篮球场",
                                "description": "场馆名称"
                            },
                            "type": {
                                "type": "string",
                                "example": "basketball",
                                "description": "场馆类型"
                            },
                            "address": {
                                "type": "string",
                                "example": "北京市朝阳区体育馆路1号",
                                "description": "场馆地址"
                            },
                            "location": {
                                "type": "string",
                                "example": "北京",
                                "description": "所在区域"
                            },
                            "latitude": {
                                "type": "number",
                                "example": 39.9042,
                                "description": "纬度"
                            },
                            "longitude": {
                                "type": "number",
                                "example": 116.4074,
                                "description": "经度"
                            },
                            "description": {
                                "type": "string",
                                "example": "标准篮球场，设施齐全",
                                "description": "场馆描述"
                            },
                            "images": {
                                "type": "array",
                                "description": "场馆图片URL列表",
                                "items": {
                                    "type": "string",
                                    "example": "https://example.com/venue1.jpg"
                                }
                            },
                            "contact_phone": {
                                "type": "string",
                                "example": "010-12345678",
                                "description": "联系电话"
                            },
                            "open_time": {
                                "type": "string",
                                "example": "08:00-22:00",
                                "description": "营业时间"
                            },
                            "max_capacity": {
                                "type": "integer",
                                "example": 50,
                                "description": "最大容量"
                            },
                            "status": {
                                "type": "integer",
                                "example": 1,
                                "description": "状态：0=关闭，1=开放"
                            },
                            "created_at": {
                                "type": "string",
                                "example": "2024-01-01 12:00:00",
                                "description": "创建时间"
                            },
                            "time_slots": {
                                "type": "array",
                                "description": "场馆时间段列表",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "时间段ID"
                                        },
                                        "venue_id": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "场馆ID"
                                        },
                                        "day_of_week": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "星期几：1-7代表周一到周日"
                                        },
                                        "start_time": {
                                            "type": "string",
                                            "example": "08:00",
                                            "description": "开始时间"
                                        },
                                        "end_time": {
                                            "type": "string",
                                            "example": "10:00",
                                            "description": "结束时间"
                                        },
                                        "price": {
                                            "type": "number",
                                            "example": 100.00,
                                            "description": "价格"
                                        },
                                        "capacity": {
                                            "type": "integer",
                                            "example": 10,
                                            "description": "容量"
                                        },
                                        "status": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "状态：0=关闭，1=开放"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "404": {
            "description": "场馆不存在",
            "schema": {
                "type": "object",
                "properties": {
                    "code": {"type": "integer", "example": 404},
                    "message": {"type": "string", "example": "场馆不存在"}
                }
            }
        }
    }
}

GET_VENUE_TIME_SLOTS_DOC = {
    "tags": ["场馆管理"],
    "summary": "获取场馆时间段",
    "description": "获取指定场馆在指定日期的可预约时间段",
    "parameters": [
        {
            "name": "venue_id",
            "in": "path",
            "type": "integer",
            "required": True,
            "description": "场馆ID",
            "example": 1
        },
        {
            "name": "date",
            "in": "query",
            "type": "string",
            "required": True,
            "description": "查询日期，格式：YYYY-MM-DD",
            "example": "2024-01-15"
        }
    ],
    "responses": {
        "200": {
            "description": "获取时间段成功",
            "schema": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "example": 200,
                        "description": "状态码"
                    },
                    "message": {
                        "type": "string",
                        "example": "获取成功",
                        "description": "响应消息"
                    },
                    "data": {
                        "type": "object",
                        "description": "时间段数据",
                        "properties": {
                            "venue": {
                                "type": "object",
                                "description": "场馆基本信息",
                                "properties": {
                                    "id": {"type": "integer", "example": 1},
                                    "name": {"type": "string", "example": "中央篮球场"},
                                    "type": {"type": "string", "example": "basketball"},
                                    "address": {"type": "string", "example": "北京市朝阳区体育馆路1号"}
                                }
                            },
                            "date": {
                                "type": "string",
                                "example": "2024-01-15",
                                "description": "查询日期"
                            },
                            "dayOfWeek": {
                                "type": "integer",
                                "example": 1,
                                "description": "星期几：1-7代表周一到周日"
                            },
                            "timeSlots": {
                                "type": "array",
                                "description": "可预约时间段列表",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "时间段ID"
                                        },
                                        "venue_id": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "场馆ID"
                                        },
                                        "day_of_week": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "星期几"
                                        },
                                        "start_time": {
                                            "type": "string",
                                            "example": "08:00",
                                            "description": "开始时间"
                                        },
                                        "end_time": {
                                            "type": "string",
                                            "example": "10:00",
                                            "description": "结束时间"
                                        },
                                        "price": {
                                            "type": "number",
                                            "example": 100.00,
                                            "description": "价格"
                                        },
                                        "capacity": {
                                            "type": "integer",
                                            "example": 10,
                                            "description": "总容量"
                                        },
                                        "status": {
                                            "type": "integer",
                                            "example": 1,
                                            "description": "状态"
                                        },
                                        "booked": {
                                            "type": "integer",
                                            "example": 2,
                                            "description": "已预约数量"
                                        },
                                        "remaining": {
                                            "type": "integer",
                                            "example": 8,
                                            "description": "剩余可预约数量"
                                        },
                                        "available": {
                                            "type": "boolean",
                                            "example": True,
                                            "description": "是否可预约"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "400": {
            "description": "请求参数错误",
            "schema": {
                "type": "object",
                "properties": {
                    "code": {"type": "integer", "example": 400},
                    "message": {"type": "string", "example": "缺少日期参数"}
                }
            }
        },
        "404": {
            "description": "场馆不存在",
            "schema": {
                "type": "object",
                "properties": {
                    "code": {"type": "integer", "example": 404},
                    "message": {"type": "string", "example": "场馆不存在"}
                }
            }
        }
    }
}
